﻿
using ShiQuan.AppUpdateBLL;
using ShiQuan.Framework;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ShiQuan.AppUpdater
{
    public class FrmMain : Form
    {
        private StatusStrip sysStatusBar;
        private ToolStripStatusLabel sysStatusLabel;
        private GroupBox groupBox1;
        private TextBox txt_ServiceState;
        private Button btnStop;
        private Button btnStart;
        private Button btnUninstall;
        private Label label1;
        private Button btnInstall;
        private Label label2;
        private ToolStrip sysToolBar;
        private ToolStripButton toolStripButton1;
        private ToolStripButton toolStripButton2;
        private ToolStripDropDownButton toolStripDropDownButton1;
        private ToolStripMenuItem 关于ToolStripMenuItem;
        private GroupBox groupBox2;
        private Label label5;
        private Label label4;
        private Label label3;
        private RichTextBox txt_ServiceDesc;
        private TextBox txt_ServicePath;
        private TextBox txt_DisplayName;
        private TextBox txt_ServiceName;
        private GroupBox groupBox3;
        private TextBox txt_ServerUrl;
        private Label label7;
        private TextBox txt_Version;
        private Label label6;
        private Label label12;
        private TextBox txt_StartServices;
        private Label label10;
        private TextBox txt_StartProcess;
        private Label label11;
        private TextBox txt_StopServices;
        private Label label9;
        private TextBox txt_KillProcess;
        private Label label8;
        private NotifyIcon sysNotifyIcon;
        private ContextMenuStrip sysContextMenu;
        private ToolStripMenuItem mnuDisplay;
        private ToolStripMenuItem mnuExit;

        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源，为 true；否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要修改
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
            this.sysStatusBar = new System.Windows.Forms.StatusStrip();
            this.sysStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.btnInstall = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.btnUninstall = new System.Windows.Forms.Button();
            this.btnStart = new System.Windows.Forms.Button();
            this.btnStop = new System.Windows.Forms.Button();
            this.txt_ServiceState = new System.Windows.Forms.TextBox();
            this.sysToolBar = new System.Windows.Forms.ToolStrip();
            this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
            this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
            this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
            this.关于ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.txt_ServiceName = new System.Windows.Forms.TextBox();
            this.txt_DisplayName = new System.Windows.Forms.TextBox();
            this.txt_ServicePath = new System.Windows.Forms.TextBox();
            this.txt_ServiceDesc = new System.Windows.Forms.RichTextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.label6 = new System.Windows.Forms.Label();
            this.txt_Version = new System.Windows.Forms.TextBox();
            this.txt_ServerUrl = new System.Windows.Forms.TextBox();
            this.label7 = new System.Windows.Forms.Label();
            this.txt_KillProcess = new System.Windows.Forms.TextBox();
            this.label8 = new System.Windows.Forms.Label();
            this.txt_StopServices = new System.Windows.Forms.TextBox();
            this.label9 = new System.Windows.Forms.Label();
            this.txt_StartServices = new System.Windows.Forms.TextBox();
            this.label10 = new System.Windows.Forms.Label();
            this.txt_StartProcess = new System.Windows.Forms.TextBox();
            this.label11 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.sysNotifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
            this.sysContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.mnuDisplay = new System.Windows.Forms.ToolStripMenuItem();
            this.mnuExit = new System.Windows.Forms.ToolStripMenuItem();
            this.sysStatusBar.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.sysToolBar.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.sysContextMenu.SuspendLayout();
            this.SuspendLayout();
            // 
            // sysStatusBar
            // 
            this.sysStatusBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.sysStatusLabel});
            this.sysStatusBar.Location = new System.Drawing.Point(0, 519);
            this.sysStatusBar.Name = "sysStatusBar";
            this.sysStatusBar.Size = new System.Drawing.Size(384, 22);
            this.sysStatusBar.SizingGrip = false;
            this.sysStatusBar.TabIndex = 1;
            // 
            // sysStatusLabel
            // 
            this.sysStatusLabel.Name = "sysStatusLabel";
            this.sysStatusLabel.Size = new System.Drawing.Size(369, 17);
            this.sysStatusLabel.Spring = true;
            this.sysStatusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.txt_ServiceState);
            this.groupBox1.Controls.Add(this.btnStop);
            this.groupBox1.Controls.Add(this.btnStart);
            this.groupBox1.Controls.Add(this.btnUninstall);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.btnInstall);
            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.groupBox1.Location = new System.Drawing.Point(0, 428);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(384, 91);
            this.groupBox1.TabIndex = 2;
            this.groupBox1.TabStop = false;
            // 
            // btnInstall
            // 
            this.btnInstall.Location = new System.Drawing.Point(12, 48);
            this.btnInstall.Name = "btnInstall";
            this.btnInstall.Size = new System.Drawing.Size(75, 32);
            this.btnInstall.TabIndex = 0;
            this.btnInstall.Text = "安装";
            this.btnInstall.UseVisualStyleBackColor = true;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label1.Location = new System.Drawing.Point(22, 23);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(53, 12);
            this.label1.TabIndex = 1;
            this.label1.Text = "服务状态";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(22, 25);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(53, 12);
            this.label2.TabIndex = 2;
            this.label2.Text = "服务名称";
            // 
            // btnUninstall
            // 
            this.btnUninstall.Location = new System.Drawing.Point(93, 48);
            this.btnUninstall.Name = "btnUninstall";
            this.btnUninstall.Size = new System.Drawing.Size(75, 32);
            this.btnUninstall.TabIndex = 3;
            this.btnUninstall.Text = "卸载";
            this.btnUninstall.UseVisualStyleBackColor = true;
            // 
            // btnStart
            // 
            this.btnStart.Location = new System.Drawing.Point(216, 48);
            this.btnStart.Name = "btnStart";
            this.btnStart.Size = new System.Drawing.Size(75, 32);
            this.btnStart.TabIndex = 4;
            this.btnStart.Text = "启动";
            this.btnStart.UseVisualStyleBackColor = true;
            // 
            // btnStop
            // 
            this.btnStop.Location = new System.Drawing.Point(297, 48);
            this.btnStop.Name = "btnStop";
            this.btnStop.Size = new System.Drawing.Size(75, 32);
            this.btnStop.TabIndex = 5;
            this.btnStop.Text = "暂停";
            this.btnStop.UseVisualStyleBackColor = true;
            // 
            // txt_ServiceState
            // 
            this.txt_ServiceState.BackColor = System.Drawing.SystemColors.Info;
            this.txt_ServiceState.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_ServiceState.Location = new System.Drawing.Point(93, 18);
            this.txt_ServiceState.Name = "txt_ServiceState";
            this.txt_ServiceState.Size = new System.Drawing.Size(279, 23);
            this.txt_ServiceState.TabIndex = 6;
            this.txt_ServiceState.Text = "未安装";
            // 
            // sysToolBar
            // 
            this.sysToolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripButton1,
            this.toolStripButton2,
            this.toolStripDropDownButton1});
            this.sysToolBar.Location = new System.Drawing.Point(0, 0);
            this.sysToolBar.Name = "sysToolBar";
            this.sysToolBar.Size = new System.Drawing.Size(384, 25);
            this.sysToolBar.TabIndex = 3;
            this.sysToolBar.Text = "toolStrip1";
            // 
            // toolStripButton1
            // 
            this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
            this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton1.Name = "toolStripButton1";
            this.toolStripButton1.Size = new System.Drawing.Size(52, 22);
            this.toolStripButton1.Text = "调试";
            // 
            // toolStripButton2
            // 
            this.toolStripButton2.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
            this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton2.Name = "toolStripButton2";
            this.toolStripButton2.Size = new System.Drawing.Size(64, 22);
            this.toolStripButton2.Text = "最小化";
            // 
            // toolStripDropDownButton1
            // 
            this.toolStripDropDownButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.关于ToolStripMenuItem});
            this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
            this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
            this.toolStripDropDownButton1.Size = new System.Drawing.Size(61, 22);
            this.toolStripDropDownButton1.Text = "帮助";
            // 
            // 关于ToolStripMenuItem
            // 
            this.关于ToolStripMenuItem.Name = "关于ToolStripMenuItem";
            this.关于ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.关于ToolStripMenuItem.Text = "关于";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.label5);
            this.groupBox2.Controls.Add(this.label4);
            this.groupBox2.Controls.Add(this.label3);
            this.groupBox2.Controls.Add(this.txt_ServiceDesc);
            this.groupBox2.Controls.Add(this.txt_ServicePath);
            this.groupBox2.Controls.Add(this.txt_DisplayName);
            this.groupBox2.Controls.Add(this.txt_ServiceName);
            this.groupBox2.Controls.Add(this.label2);
            this.groupBox2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.groupBox2.Location = new System.Drawing.Point(0, 255);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(384, 173);
            this.groupBox2.TabIndex = 4;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "服务信息";
            // 
            // txt_ServiceName
            // 
            this.txt_ServiceName.BackColor = System.Drawing.SystemColors.Info;
            this.txt_ServiceName.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_ServiceName.Location = new System.Drawing.Point(93, 20);
            this.txt_ServiceName.Name = "txt_ServiceName";
            this.txt_ServiceName.Size = new System.Drawing.Size(279, 23);
            this.txt_ServiceName.TabIndex = 7;
            this.txt_ServiceName.Text = "未安装";
            // 
            // txt_DisplayName
            // 
            this.txt_DisplayName.BackColor = System.Drawing.SystemColors.Info;
            this.txt_DisplayName.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_DisplayName.Location = new System.Drawing.Point(93, 49);
            this.txt_DisplayName.Name = "txt_DisplayName";
            this.txt_DisplayName.Size = new System.Drawing.Size(279, 23);
            this.txt_DisplayName.TabIndex = 8;
            this.txt_DisplayName.Text = "未安装";
            // 
            // txt_ServicePath
            // 
            this.txt_ServicePath.BackColor = System.Drawing.SystemColors.Info;
            this.txt_ServicePath.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_ServicePath.Location = new System.Drawing.Point(93, 144);
            this.txt_ServicePath.Name = "txt_ServicePath";
            this.txt_ServicePath.Size = new System.Drawing.Size(279, 23);
            this.txt_ServicePath.TabIndex = 10;
            this.txt_ServicePath.Text = "未安装";
            // 
            // txt_ServiceDesc
            // 
            this.txt_ServiceDesc.BackColor = System.Drawing.SystemColors.Info;
            this.txt_ServiceDesc.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_ServiceDesc.Location = new System.Drawing.Point(93, 78);
            this.txt_ServiceDesc.Name = "txt_ServiceDesc";
            this.txt_ServiceDesc.ReadOnly = true;
            this.txt_ServiceDesc.Size = new System.Drawing.Size(279, 60);
            this.txt_ServiceDesc.TabIndex = 11;
            this.txt_ServiceDesc.Text = "描述";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(22, 54);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(53, 12);
            this.label3.TabIndex = 12;
            this.label3.Text = "显示名称";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(22, 81);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(29, 12);
            this.label4.TabIndex = 13;
            this.label4.Text = "描述";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(22, 149);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(53, 12);
            this.label5.TabIndex = 14;
            this.label5.Text = "程序路径";
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.label12);
            this.groupBox3.Controls.Add(this.txt_StartServices);
            this.groupBox3.Controls.Add(this.label10);
            this.groupBox3.Controls.Add(this.txt_StartProcess);
            this.groupBox3.Controls.Add(this.label11);
            this.groupBox3.Controls.Add(this.txt_StopServices);
            this.groupBox3.Controls.Add(this.label9);
            this.groupBox3.Controls.Add(this.txt_KillProcess);
            this.groupBox3.Controls.Add(this.label8);
            this.groupBox3.Controls.Add(this.txt_ServerUrl);
            this.groupBox3.Controls.Add(this.label7);
            this.groupBox3.Controls.Add(this.txt_Version);
            this.groupBox3.Controls.Add(this.label6);
            this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.groupBox3.Location = new System.Drawing.Point(0, 25);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(384, 230);
            this.groupBox3.TabIndex = 5;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "程序信息";
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(22, 25);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(53, 12);
            this.label6.TabIndex = 3;
            this.label6.Text = "程序版本";
            // 
            // txt_Version
            // 
            this.txt_Version.BackColor = System.Drawing.SystemColors.Info;
            this.txt_Version.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_Version.Location = new System.Drawing.Point(93, 20);
            this.txt_Version.Name = "txt_Version";
            this.txt_Version.Size = new System.Drawing.Size(279, 23);
            this.txt_Version.TabIndex = 8;
            this.txt_Version.Text = "未安装";
            // 
            // txt_ServerUrl
            // 
            this.txt_ServerUrl.BackColor = System.Drawing.SystemColors.Info;
            this.txt_ServerUrl.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_ServerUrl.Location = new System.Drawing.Point(93, 49);
            this.txt_ServerUrl.Name = "txt_ServerUrl";
            this.txt_ServerUrl.Size = new System.Drawing.Size(279, 23);
            this.txt_ServerUrl.TabIndex = 10;
            this.txt_ServerUrl.Text = "未安装";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(22, 54);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(65, 12);
            this.label7.TabIndex = 9;
            this.label7.Text = "服务器版本";
            // 
            // txt_KillProcess
            // 
            this.txt_KillProcess.BackColor = System.Drawing.SystemColors.Info;
            this.txt_KillProcess.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_KillProcess.Location = new System.Drawing.Point(93, 78);
            this.txt_KillProcess.Name = "txt_KillProcess";
            this.txt_KillProcess.Size = new System.Drawing.Size(279, 23);
            this.txt_KillProcess.TabIndex = 12;
            this.txt_KillProcess.Text = "未安装";
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(12, 83);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(77, 12);
            this.label8.TabIndex = 11;
            this.label8.Text = "需要关闭程序";
            // 
            // txt_StopServices
            // 
            this.txt_StopServices.BackColor = System.Drawing.SystemColors.Info;
            this.txt_StopServices.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_StopServices.Location = new System.Drawing.Point(93, 107);
            this.txt_StopServices.Name = "txt_StopServices";
            this.txt_StopServices.Size = new System.Drawing.Size(279, 23);
            this.txt_StopServices.TabIndex = 14;
            this.txt_StopServices.Text = "未安装";
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(10, 112);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(77, 12);
            this.label9.TabIndex = 13;
            this.label9.Text = "需要关闭服务";
            // 
            // txt_StartServices
            // 
            this.txt_StartServices.BackColor = System.Drawing.SystemColors.Info;
            this.txt_StartServices.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_StartServices.Location = new System.Drawing.Point(93, 165);
            this.txt_StartServices.Name = "txt_StartServices";
            this.txt_StartServices.Size = new System.Drawing.Size(279, 23);
            this.txt_StartServices.TabIndex = 18;
            this.txt_StartServices.Text = "未安装";
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.Location = new System.Drawing.Point(10, 170);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(77, 12);
            this.label10.TabIndex = 17;
            this.label10.Text = "更新重启服务";
            // 
            // txt_StartProcess
            // 
            this.txt_StartProcess.BackColor = System.Drawing.SystemColors.Info;
            this.txt_StartProcess.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txt_StartProcess.Location = new System.Drawing.Point(93, 136);
            this.txt_StartProcess.Name = "txt_StartProcess";
            this.txt_StartProcess.Size = new System.Drawing.Size(279, 23);
            this.txt_StartProcess.TabIndex = 16;
            this.txt_StartProcess.Text = "未安装";
            // 
            // label11
            // 
            this.label11.AutoSize = true;
            this.label11.Location = new System.Drawing.Point(12, 141);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(77, 12);
            this.label11.TabIndex = 15;
            this.label11.Text = "更新重启程序";
            // 
            // label12
            // 
            this.label12.AutoSize = true;
            this.label12.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label12.ForeColor = System.Drawing.Color.Blue;
            this.label12.Location = new System.Drawing.Point(56, 202);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(272, 12);
            this.label12.TabIndex = 19;
            this.label12.Text = "注：关闭或重启程序，多个用分号（;）分隔！";
            // 
            // sysNotifyIcon
            // 
            this.sysNotifyIcon.ContextMenuStrip = this.sysContextMenu;
            this.sysNotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("sysNotifyIcon.Icon")));
            this.sysNotifyIcon.Text = "notifyIcon1";
            this.sysNotifyIcon.Visible = true;
            // 
            // sysContextMenu
            // 
            this.sysContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.mnuDisplay,
            this.mnuExit});
            this.sysContextMenu.Name = "sysContextMenu";
            this.sysContextMenu.Size = new System.Drawing.Size(101, 48);
            // 
            // mnuDisplay
            // 
            this.mnuDisplay.Name = "mnuDisplay";
            this.mnuDisplay.Size = new System.Drawing.Size(100, 22);
            this.mnuDisplay.Text = "显示";
            // 
            // mnuExit
            // 
            this.mnuExit.Name = "mnuExit";
            this.mnuExit.Size = new System.Drawing.Size(100, 22);
            this.mnuExit.Text = "退出";
            // 
            // FrmMain
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(384, 541);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.sysToolBar);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.sysStatusBar);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "FrmMain";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "更新服务管理";
            this.sysStatusBar.ResumeLayout(false);
            this.sysStatusBar.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.sysToolBar.ResumeLayout(false);
            this.sysToolBar.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.sysContextMenu.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        
        public FrmMain()
        {
            InitializeComponent();
            
            this.Load += FrmMain_Load;
        }
        private System.Timers.Timer sysTimer = null;
        private void FrmMain_Load(object sender, EventArgs e)
        {
            this.Text = this.sysNotifyIcon.Text= Application.ProductName + "("+Application.ProductVersion+")";

            this.sysNotifyIcon.DoubleClick += SysNotifyIcon_DoubleClick;

            this.btnInstall.Click += BtnInstall_Click;
            this.btnUninstall.Click += BtnUninstall_Click;
            this.btnStart.Click += BtnStart_Click;
            this.btnStop.Click += BtnStop_Click;

            this.FormClosing += FrmMain_FormClosing;

            this.sysTimer = new System.Timers.Timer();
            this.sysTimer.Interval = 1000;
            this.sysTimer.Elapsed += SysTimer_Elapsed;
            this.sysTimer.Start();
        }

        private void SysTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            this.Invoke((EventHandler)delegate {

            });
        }

        private void SysNotifyIcon_DoubleClick(object sender, EventArgs e)
        {
            this.Show();
            this.Activate();
        }

        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            if(this.sysTimer != null)
                this.sysTimer.Stop();

            this.sysNotifyIcon.Visible = false;
            this.sysNotifyIcon.Dispose();
            this.sysNotifyIcon = null;
        }

        private void BtnStop_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        private void BtnStart_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        private void BtnUninstall_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        private void BtnInstall_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        private void LoadInfo()
        {
            string error = string.Empty;
            var localInfo = new AppUpdaterBLL().GetLocalInfo(AppSetting.AppPath, out error);
            if(localInfo == null)
            {
                WinMessageBox.Warning(error);
                return;
            }


        }
        
    }
}
